package com.mysoft.gfyx.workbench.controller;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.workbench.controller.dto.GetUserTokenRequestDto;
import com.mysoft.gfyx.workbench.controller.dto.GetUserTokenResponseDto;
import com.mysoft.gfyx.workbench.service.YcgService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

@PubService(value = "/authPub", prefix = RequestPrefix.PUB, method = RequestMethod.POST)
@Tag(name = "认证控制器-Pub")
public class AuthPubController  extends Controller implements DataApi {

    @Autowired
    private YcgService ycgService;

    @PubAction(value = "/getUserToken", method = RequestMethod.POST)
    public GetUserTokenResponseDto getUserToken(@RequestBody GetUserTokenRequestDto getUserTokenRequestDto) {
        return ycgService.getUserToken(getUserTokenRequestDto.getUserCode());
    }
}
